﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web/FarmMaster.master"  %>

<script runat="server">

</script>
<asp:Content ID="Content3" ContentPlaceHolderID="KeywordsHolder" Runat="Server">
    <%
        CmsDataContext db= new CmsDataContext();
        Article article = (from  aA in db.Article
                           where aA.ID == Request.Params["aid"]
                           select aA).First();
    %>    
    
    <meta name="keywords" content="<%=article.Keywords %>"/>
    <meta name="keywords" content="<%=article.Title %>"/>
    <meta name="keywords" content="<%=article.Subtitle %>"/>
    <meta name="keywords" content="<%=article.District %>"/>
    <meta name="keywords" content="<%=article.Belong %>"/>
</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $.ajax({
                type: "POST",
                url: '../FetchRelative.aspx?aid=<%=Request.Params["aid"] %>',
                success: function (msg) {
                    $('#RelativeArticleContent').html(msg);
                },
                error: function (msg) {
                    $('#RelativeArticleContent').html(msg);
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <%
        CmsDataContext db= new CmsDataContext();
        Article article = (from  aA in db.Article
                           where aA.ID == Request.Params["aid"]
                           select aA).First();

        var annex=from aA in db.Annex where aA.ArticleID.Equals(Request.Params["aid"]) select aA;


        string topic_id = article.TopicID;
        string path = (from aF in db.Topic where aF.ID.Equals(topic_id) select aF).First().Name;
        int count=0;
        while ((count = (from aF in db.Topic where aF.ParentID.Equals(topic_id) select aF).Count())!=0)
        {
            topic_id = (from aF in db.Topic where aF.ParentID.Equals(topic_id) select aF).First().ID;
            path = (from aF in db.Topic where aF.ID.Equals(topic_id) select aF).First().Name + path;
        }
        path = "首页-->" + path;
        
    %>
    
    <div id="main">
		<div class="left">
			<div class="left2" style="padding-top:13px;">
				<div class="tle">
					<span class="text1">相关文章</span>
				</div>
				<div class="tents">
					<ul style=" padding-top:5px;" id="RelativeArticleContent">
                        
						
					</ul>
				</div>

			</div>
			<div class="left2">
                <asp:Image ID="Image1" runat="server" SkinID="telImage1"/>
			</div>
		</div>
		<div class="right">
			<div class="headline">  
				您的当前位置：<%=path %>
			</div>
			<div class="content">
				<div class="title">
					<div class="writing">
						<%=article.Title%>
					</div>
					<div class="information">
                        <span>作者：<%=article.Creator.Name%></span>
                        <span>来源：<%=article.District%></span>
                        <span>发表日期：<%=string.Format("{0:yyyy年MM月dd日 HH:mm}", article.Published)%></span>
                        <span>责任编辑：<%=article.Verifier==null?"佚名":article.Verifier.Name%></span>
					</div>
				</div>
				<div class="detail">
					<span class="d2">
						<%=article.Body%>
					</span>
				</div>
                <div class="fujian">
                    <%
                        if (annex.Count() != 0)
                        {
                            foreach (Annex ann in annex)
                            { 
                        %>    <ul>
		                        <li>
                                    <asp:Image ID="Image2" runat="server" SkinID="AnnexImage" /></li>
		                        <li><%=ann.Title %></li>
		                        <li style="padding-left:6px;"><a href="<%=Toolkit.ApplicationRoot %>/Upload/<%=ann.Url %>">点击下载</a></li>
	                        </ul>    
                        <%  }
                        }   
                     %>
	                
                </div>
			</div>

		</div>
	</div>
</asp:Content>